//for show tools
$(document).ready(function() {
	$("#topheader").fadeIn("fast");
	initStyle();
	$("#search_lens").click(function(){ $('#search_form').submit(); });
});

function initStyle(){
	var w = 728;
	if(window.innerWidth){
		var winWidth=window.innerWidth;
		w = winWidth > 728 ? winWidth : 728;
	} else if( (document.body)&&(document.body.clientWidth) ){
		winWidth = document.body.clientWidth;
		w = winWidth > 728 ? winWidth : 728;
	}
	$("#topheader").css( "width",w );
}

$(window).bind('resize', initStyle);

function menuFixed(id){
    var obj = document.getElementById(id);
    var _getHeight = obj.offsetTop;
	
    
    window.onscroll = function(){
        changePos(id,_getHeight);
    }
}
function changePos(id,height){
    var obj = document.getElementById(id);
    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
    if(scrollTop < height){
        obj.style.position = 'relative';
    }else{
        obj.style.position = 'fixed';
    }
}